package com.AI;


import android.location.GpsStatus;
import android.location.Location;
import android.location.LocationListener;
import android.location.GpsStatus.Listener;
import android.os.Bundle;
import android.os.Message;
import android.util.Log;

public class GPSListener implements LocationListener {

	public void run()
	{
	}
	
	//@Override
	public void onLocationChanged(Location location) {
		
		Message msg = new Message();
		Log.d("PROVIDER:", "gps: " + location.getProvider());
		if (location != null)
		{
			if (location.getProvider().equals("network"))
			{
				//Main.foundProvider = true;
			}
			else {
				//Main.foundGPS = true;
			}
			
			UserModel.lati = location.getLatitude();
			UserModel.longi = location.getLongitude();
			
		}
	}

	//@Override
	public void onProviderDisabled(String provider) {
	}

	//@Override
	public void onProviderEnabled(String provider) {

	}

	//@Override
	public void onStatusChanged(String provider, int status, Bundle extras) {
		// TODO Auto-generated method stub
		
	}
	
	private final Listener onGpsStatusChange = new GpsStatus.Listener()
	{

		//@Override
		public void onGpsStatusChanged(int event) {
			switch (event)
			{
			case GpsStatus.GPS_EVENT_FIRST_FIX:
				Log.d("GPS", "first fixxxxxxxxxxxxx");
			case GpsStatus.GPS_EVENT_SATELLITE_STATUS:
				Log.d("GPS", "STATUSSSSSSSSSSSSSSSSS");
			}
		}
	};
}
